#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main() {
	int a[90000];
	for (int i = 0; i < 90000; i++) {
		a[i] = i + 10000;
	}
	for (int i = 0; i < 90000; i++) {
		if (a[i] == (a[i] / 10) * (a[i] % 10) + (a[i] / 100) * (a[i] % 100) + (a[i] / 1000) * (a[i] % 1000) + (a[i] / 10000) * (a[i] % 10000)) {
			printf("%d ", a[i]);
		}
	}
	return 0;
}
